package util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class PrintUtils {
    public static void arrayInt(int[][] source) {
        for (int i = 0; i < source.length; i++) {
            System.out.print("seq:" + i + ";  ");
            arrayInt(source[i]);
        }
    }

    public static void arrayInt(int[] source) {
        Integer[] array = new Integer[source.length];
        for (int i = 0; i < source.length; i++) {
            array[i] = source[i];
        }
        array(array);
    }

    public static <T> void array(T[] source) {
        if (source == null) {
            System.out.println("");
        }
        for (int i = 0; i < source.length; i++) {
            if (i == 0) {
                System.out.print(source[i]);
            } else {
                System.out.print("," + source[i]);
            }
        }
        System.out.println();
    }

    public static void transfer(String source) {
        String s = source.replace('[', '{').replace(']', '}').replace("\"", "'");
        System.out.println(s);
    }

    public static <T> List<T> newArrayList(T ...args) {
        return new ArrayList<>(Arrays.asList(args));
    }
}
